﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using DTO;
using BUS;

namespace EXAM.Admin.A_ucontrol
{
    public partial class UsrTop : System.Web.UI.UserControl
    {
        public string strUsername;
        string _sErr = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (Session["Username"] == null)
            //{
            //    Response.Redirect("~/Admin/Login.aspx");
            //    return;
            //}
            //else
            //{
            //    strUsername = Session["Username"].ToString();
            //}
            if (!IsPostBack)
            {
                if (Session["UserAdmin"] != null)
                {
                    DTO.UserInfo user= Session["UserAdmin"] as DTO.UserInfo;
                    lblFullname.Text = user.Lastname + " " + user.Firstname;
                }

            }
        }
        protected void btnLogout_Click(object sender, EventArgs e)
        {
            Session["Username"] = null;
            Response.Redirect("~/Admin/Login.aspx");
        }

        protected void btnChangePassword_Click(object sender, EventArgs e)
        {
            Response.Redirect("~/Admin/Page_Admin/ChangePass.aspx");
        }
    }
}